package com.CmJava.crowd.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

// 对象存进redis必要要实现Serializable，不然无法序列化
public class FundMoneyBy14Days implements Serializable {
    private int primaryKey;
    private ArrayList<DateAndMoney> fundMoney;
    private int fundPeople;
    public FundMoneyBy14Days() {
    }

    public FundMoneyBy14Days(int primaryKey, ArrayList<DateAndMoney> fundMoney) {
        this.primaryKey = primaryKey;
        this.fundMoney = fundMoney;
        if (fundMoney!=null) {
            this.fundPeople = fundMoney.size();
        }
    }

    public int getPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(int primaryKey) {
        this.primaryKey = primaryKey;
    }

    public ArrayList<DateAndMoney> getFundMoney() {
        return fundMoney;
    }

    public void setFundMoney(ArrayList<DateAndMoney> fundMoney) {
        this.fundMoney = fundMoney;
        this.fundPeople=fundMoney.size();
    }

    public int getFundPeople() {
        return fundPeople;
    }

    public void setFundPeople(int fundPeople) {
        this.fundPeople = fundPeople;
    }

    @Override
    public String toString() {
        return "FundMoneyBy14Days{" +
                "primaryKey=" + primaryKey +
                ", fundMoney=" + fundMoney +
                ", fundPeople=" + fundPeople +
                '}';
    }
    public class DateAndMoney extends HashMap<String,Integer>{
        public DateAndMoney() {
        }

        public DateAndMoney(Map<? extends String, ? extends Integer> m) {
            super(m);
        }
    }
}
